﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.Composite.Regions;
using Microsoft.Practices.Composite.Modularity;
using Microsoft.Practices.Unity;

namespace PJ.Presentation.Partner
{
    public class CustomerModule : IModule
    {
        private readonly IRegionManager m_RegionManager;
        private readonly IUnityContainer m_Container;

        public CustomerModule(IUnityContainer container, IRegionManager regionManager)
        {
            this.m_Container = container;
            this.m_RegionManager = regionManager;
        }

        public void Initialize()
        {
            m_RegionManager.Regions["HeaderRegion"].Add(m_Container.Resolve<ICustomerModel>().View);
            m_RegionManager.Regions["LeftRegion1"].Add(m_Container.Resolve<ICustomerSearchModel>().View);
            m_RegionManager.Regions["LeftRegion2"].Add(m_Container.Resolve<ICustomerListModel>().View);
        }
    }
}
